﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiHlrResults : OdRxObject
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiHlrResults(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGiHlrResults_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiHlrResults obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiHlrResults()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiHlrResults(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdGiHlrResults cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiHlrResults_cast(OdRxObject.getCPtr(pObj));
			OdGiHlrResults result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiHlrResults)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiHlrResults)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiHlrResults)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiHlrResults_desc(), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiHlrResults_isA(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(GlobalsPINVOKE.OdGiHlrResults_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static OdGiHlrResults createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiHlrResults_createObject();
			OdGiHlrResults result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiHlrResults)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiHlrResults)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiHlrResults)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGiHlrResults.Data next()
		{
			IntPtr intPtr = GlobalsPINVOKE.OdGiHlrResults_next(this.swigCPtr);
			OdGiHlrResults.Data result = (intPtr == IntPtr.Zero) ? null : new OdGiHlrResults.Data(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void start()
		{
			GlobalsPINVOKE.OdGiHlrResults_start(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		public class Traits : IDisposable
		{
			[EditorBrowsable(EditorBrowsableState.Never)]
			public Traits(IntPtr cPtr, bool cMemoryOwn)
			{
				this.swigCMemOwn = cMemoryOwn;
				this.swigCPtr = new HandleRef(this, cPtr);
			}

			[EditorBrowsable(EditorBrowsableState.Never)]
			public static HandleRef getCPtr(OdGiHlrResults.Traits obj)
			{
				if (obj != null)
				{
					return obj.swigCPtr;
				}
				return new HandleRef(null, IntPtr.Zero);
			}

			~Traits()
			{
				this.Dispose();
			}

			public virtual void Dispose()
			{
				if (this.swigCPtr.Handle != IntPtr.Zero)
				{
					if (this.swigCMemOwn)
					{
						lock (this.locker)
						{
							if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
							{
								this.swigCMemOwn = false;
								GlobalsPINVOKE.delete_OdGiHlrResults_Traits(this.swigCPtr);
							}
						}
						this.swigCMemOwn = false;
					}
					this.swigCPtr = new HandleRef(null, IntPtr.Zero);
				}
				GC.SuppressFinalize(this);
			}

			public IntPtr selMarker
			{
				get
				{
					IntPtr result = GlobalsPINVOKE.OdGiHlrResults_Traits_selMarker_get(this.swigCPtr);
					if (GlobalsPINVOKE.SWIGPendingException.Pending)
					{
						throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
					}
					return result;
				}
				set
				{
					GlobalsPINVOKE.OdGiHlrResults_Traits_selMarker_set(this.swigCPtr, value);
					if (GlobalsPINVOKE.SWIGPendingException.Pending)
					{
						throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
					}
				}
			}

			public OdCmEntityColor color
			{
				get
				{
					IntPtr intPtr = GlobalsPINVOKE.OdGiHlrResults_Traits_color_get(this.swigCPtr);
					OdCmEntityColor result = (intPtr == IntPtr.Zero) ? null : new OdCmEntityColor(intPtr, false);
					if (GlobalsPINVOKE.SWIGPendingException.Pending)
					{
						throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
					}
					return result;
				}
				set
				{
					GlobalsPINVOKE.OdGiHlrResults_Traits_color_set(this.swigCPtr, OdCmEntityColor.getCPtr(value));
					if (GlobalsPINVOKE.SWIGPendingException.Pending)
					{
						throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
					}
				}
			}

			public LineWeight lineWeight
			{
				get
				{
					LineWeight result = (LineWeight)GlobalsPINVOKE.OdGiHlrResults_Traits_lineWeight_get(this.swigCPtr);
					if (GlobalsPINVOKE.SWIGPendingException.Pending)
					{
						throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
					}
					return result;
				}
				set
				{
					GlobalsPINVOKE.OdGiHlrResults_Traits_lineWeight_set(this.swigCPtr, (int)value);
					if (GlobalsPINVOKE.SWIGPendingException.Pending)
					{
						throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
					}
				}
			}

			public Traits() : this(GlobalsPINVOKE.new_OdGiHlrResults_Traits(), true)
			{
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}

			private object locker = new object();

			private HandleRef swigCPtr;

			protected bool swigCMemOwn;
		}

		public class Data : IDisposable
		{
			[EditorBrowsable(EditorBrowsableState.Never)]
			public Data(IntPtr cPtr, bool cMemoryOwn)
			{
				this.swigCMemOwn = cMemoryOwn;
				this.swigCPtr = new HandleRef(this, cPtr);
			}

			[EditorBrowsable(EditorBrowsableState.Never)]
			public static HandleRef getCPtr(OdGiHlrResults.Data obj)
			{
				if (obj != null)
				{
					return obj.swigCPtr;
				}
				return new HandleRef(null, IntPtr.Zero);
			}

			~Data()
			{
				this.Dispose();
			}

			public virtual void Dispose()
			{
				if (this.swigCPtr.Handle != IntPtr.Zero)
				{
					if (this.swigCMemOwn)
					{
						lock (this.locker)
						{
							if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
							{
								this.swigCMemOwn = false;
								GlobalsPINVOKE.delete_OdGiHlrResults_Data(this.swigCPtr);
							}
						}
						this.swigCMemOwn = false;
					}
					this.swigCPtr = new HandleRef(null, IntPtr.Zero);
				}
				GC.SuppressFinalize(this);
			}

			public OdGiHlrResults.Traits pTraits
			{
				get
				{
					IntPtr intPtr = GlobalsPINVOKE.OdGiHlrResults_Data_pTraits_get(this.swigCPtr);
					OdGiHlrResults.Traits result = (intPtr == IntPtr.Zero) ? null : new OdGiHlrResults.Traits(intPtr, false);
					if (GlobalsPINVOKE.SWIGPendingException.Pending)
					{
						throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
					}
					return result;
				}
				set
				{
					GlobalsPINVOKE.OdGiHlrResults_Data_pTraits_set(this.swigCPtr, OdGiHlrResults.Traits.getCPtr(value));
					if (GlobalsPINVOKE.SWIGPendingException.Pending)
					{
						throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
					}
				}
			}

			public OdGePoint3dArray visible
			{
				get
				{
					IntPtr intPtr = GlobalsPINVOKE.OdGiHlrResults_Data_visible_get(this.swigCPtr);
					OdGePoint3dArray result = (intPtr == IntPtr.Zero) ? null : new OdGePoint3dArray(intPtr, false);
					if (GlobalsPINVOKE.SWIGPendingException.Pending)
					{
						throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
					}
					return result;
				}
				set
				{
					GlobalsPINVOKE.OdGiHlrResults_Data_visible_set(this.swigCPtr, OdGePoint3dArray.getCPtr(value));
					if (GlobalsPINVOKE.SWIGPendingException.Pending)
					{
						throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
					}
				}
			}

			public OdGePoint3dArray hidden
			{
				get
				{
					IntPtr intPtr = GlobalsPINVOKE.OdGiHlrResults_Data_hidden_get(this.swigCPtr);
					OdGePoint3dArray result = (intPtr == IntPtr.Zero) ? null : new OdGePoint3dArray(intPtr, false);
					if (GlobalsPINVOKE.SWIGPendingException.Pending)
					{
						throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
					}
					return result;
				}
				set
				{
					GlobalsPINVOKE.OdGiHlrResults_Data_hidden_set(this.swigCPtr, OdGePoint3dArray.getCPtr(value));
					if (GlobalsPINVOKE.SWIGPendingException.Pending)
					{
						throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
					}
				}
			}

			public Data() : this(GlobalsPINVOKE.new_OdGiHlrResults_Data(), true)
			{
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}

			private object locker = new object();

			private HandleRef swigCPtr;

			protected bool swigCMemOwn;
		}
	}
}
